home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / QFLOAT / QLOG10.C < prev    next >
C/C++ Source or Header  |  1996-02-28  |  1KB  |  43 lines

  1. /*    qlog10    */
  2.  
  3. #include "qhead.h"
  4. /* Initilaize 1/loge(10) */
  5. #if WORDSIZE ==  32
  6. #if NQ > 8
  7. static QELT ql10e[NQ] = {
  8. 0,EXPONE-2,0,0xde5bd8a9,0x37287195,0x355baaaf,0xad33dc32,0x3ee34602,
  9. 0x45c9a202,0x3a3f2d44,0xf78ea53c,0x75424efa,0x1402f3f2,0x92235593
  10. };
  11. #else
  12. /* 4.34294481903251827651128918916605082294397005803667E-1 */
  13. static QELT ql10e[NQ] = {
  14. 0,EXPONE-2,0,0xde5bd8a9,0x37287195,0x355baaaf,0xad33dc32,0x3ee34602};
  15. #endif
  16. #else
  17. /* word size is 16 */
  18. #if NQ > 12
  19. static short ql10e[NQ] = {
  20. 0x0000,EXPONE-2,0x0000,0xde5b,0xd8a9,0x3728,0x7195,0x355b,
  21. 0xaaaf,0xad33,0xdc32,0x3ee3,0x4602,0x45c9,0xa202,0x3a3f,
  22. 0x2d44,0xf78e,0xa53c,0x7542,0x4efa,0x1402,0xf3f2,0x9223
  23. };
  24. #else
  25. /* 4.34294481903251827651128918916605082294397005803667E-1 */
  26. static short ql10e[NQ] = {
  27. 0000000,EXPONE-2,0000000,0157133,0154251,0033450,
  28. 0070625,0032533,0125257,0126463,0156062,0037343};
  29. #endif
  30. #endif
  31.  
  32.  
  33. int qlog10( x, y )
  34. QELT x[], y[];
  35. {
  36. QELT a[NQ];
  37.  
  38. qlog( x, a );
  39.  
  40. qmul( ql10e, a, y );
  41. return 0;
  42.  }
  43.